<template>
  <el-container class="release_container">
    <el-form ref="form" :model="form" label-width="100px">
      <el-form-item label="充值金额">
        <el-input v-model="form.name" placeholder="请填写金额"></el-input>
      </el-form-item>
      
      <el-form-item label="密码">
        <el-input v-model="form.age" placeholder="请输入您的交易密码"></el-input>
      </el-form-item>
      
      
      <el-form-item>
        <el-button type="primary" @click="onSubmit">充值</el-button>
        <el-button>取消</el-button>
      </el-form-item>
    </el-form>
  </el-container>
</template>

<script>
export default {
  data() {
    return {
      form: {
        price: '',
        password: ''
      },
    }
  },
  methods: {
    onSubmit() {
      console.log('submit!');
      let self = this

      console.log(this.imageUrl) 

      let param = {
        id : localStorage.getItem("id"),
        price:self.form.price,
        password:self.form.password,
      }

      let config = {
        headers: {'Content-Type': 'application/json','Authorization':localStorage.getItem("token")}
      }

      // 添加请求头
      this.$axios.put('/user', param, config)
      .then(function (response) {
      // handle success
        console.log(response);
      })
      .catch(function (error) {
      // handle error
        console.log(error);
      })
      .then(function () {
      // always executed
        
      });
    }
  }  
}
</script>

<style lang="less" scoped>
.release_container {
  height: 100%;
}
</style>